import java.util.Scanner;
public class SimulateLogin {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int i=3;
        while(i!=0) {
            System.out.println("请输入你的密码");
            String password= sc.nextLine();
            if(password.equals("123")){
                System.out.println("登录成功");
                break;
            }
            else{
                i--;
                System.out.println("你还有"+i+"次机会");
            }
        }
    }
}